/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.tesoreria.be;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Administrador
 */
@Entity
@Table(name = "tes_historial_cajachica")
@NamedQueries({@NamedQuery(name = "HistorialCajachica.findAll", query = "SELECT h FROM HistorialCajachica h"), @NamedQuery(name = "HistorialCajachica.findByHccCodigo", query = "SELECT h FROM HistorialCajachica h WHERE h.hccCodigo = :hccCodigo"), @NamedQuery(name = "HistorialCajachica.findByFkPerCodigopna", query = "SELECT h FROM HistorialCajachica h WHERE h.fkPerCodigopna = :fkPerCodigopna")})
public class HistorialCajachica implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "hcc_codigo", nullable = false)
    private Long hccCodigo;
    @Basic(optional = false)
    @Column(name = "fk_per_codigopna", nullable = false)
    private long fkPerCodigopna;
    @JoinColumn(name = "cac_codigo", referencedColumnName = "cac_codigo", nullable = false)
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private CajaChica cacCodigo;

    public HistorialCajachica() {
    }

    public HistorialCajachica(Long hccCodigo) {
        this.hccCodigo = hccCodigo;
    }

    public HistorialCajachica(Long hccCodigo, long fkPerCodigopna) {
        this.hccCodigo = hccCodigo;
        this.fkPerCodigopna = fkPerCodigopna;
    }

    public Long getHccCodigo() {
        return hccCodigo;
    }

    public void setHccCodigo(Long hccCodigo) {
        this.hccCodigo = hccCodigo;
    }

    public long getFkPerCodigopna() {
        return fkPerCodigopna;
    }

    public void setFkPerCodigopna(long fkPerCodigopna) {
        this.fkPerCodigopna = fkPerCodigopna;
    }

    public CajaChica getCacCodigo() {
        return cacCodigo;
    }

    public void setCacCodigo(CajaChica cacCodigo) {
        this.cacCodigo = cacCodigo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (hccCodigo != null ? hccCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof HistorialCajachica)) {
            return false;
        }
        HistorialCajachica other = (HistorialCajachica) object;
        if ((this.hccCodigo == null && other.hccCodigo != null) || (this.hccCodigo != null && !this.hccCodigo.equals(other.hccCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.cip.esymons.tesoreria.be.HistorialCajachica[hccCodigo=" + hccCodigo + "]";
    }

}
